local primarygenerator = function(r, g, b)
	return {
		ambient = { 0, 0, 0 },
		diffuse = { r, g, b },
		specular = { 0, 0, 0 },
		shininess = 0.6,
	};
end

materials = {};

materials.kilgard = {
	emerald = { ambient= { 0.0215, 0.1745, 0.0215 }, diffuse= { 0.07568, 0.61424, 0.07568 }, specular= { 0.633, 0.727811, 0.633 }, shininess=0.6 },
	jade = { ambient= { 0.135, 0.2225, 0.1575 }, diffuse= { 0.54, 0.89, 0.63 }, specular= { 0.316228, 0.316228, 0.316228 }, shininess=0.1 },
	obsidian = { ambient= { 0.05375, 0.05, 0.06625 }, diffuse= { 0.18275, 0.17, 0.22525 }, specular= { 0.332741, 0.328634, 0.346435 }, shininess=0.3 },
	pearl = { ambient= { 0.25, 0.20725, 0.20725 }, diffuse= { 1, 0.829, 0.829 }, specular= { 0.296648, 0.296648, 0.296648 }, shininess=0.088 },
	ruby = { ambient= { 0.1745, 0.01175, 0.01175 }, diffuse= { 0.61424, 0.04136, 0.04136 }, specular= { 0.727811, 0.626959, 0.626959 }, shininess=0.6 },
	turquoise = { ambient= { 0.1, 0.18725, 0.1745 }, diffuse= { 0.396, 0.74151, 0.69102 }, specular= { 0.297254, 0.30829, 0.306678 }, shininess=0.1 },
	brass = { ambient= { 0.329412, 0.223529, 0.027451 }, diffuse= { 0.780392, 0.568627, 0.113725 }, specular= { 0.992157, 0.941176, 0.807843 }, shininess=0.21794872 },
	bronze = { ambient= { 0.2125, 0.1275, 0.054 }, diffuse= { 0.714, 0.4284, 0.18144 }, specular= { 0.393548, 0.271906, 0.166721 }, shininess=0.2 },
	chrome = { ambient= { 0.25, 0.25, 0.25 }, diffuse= { 0.4, 0.4, 0.4 }, specular= { 0.774597, 0.774597, 0.774597 }, shininess=0.6 },
	copper = { ambient= { 0.19125, 0.0735, 0.0225 }, diffuse= { 0.7038, 0.27048, 0.0828 }, specular= { 0.256777, 0.137622, 0.086014 }, shininess=0.1 },
	gold = { ambient= { 0.24725, 0.1995, 0.0745 }, diffuse= { 0.75164, 0.60648, 0.22648 }, specular= { 0.628281, 0.555802, 0.366065 }, shininess=0.4 },
	silver = { ambient= { 0.19225, 0.19225, 0.19225 }, diffuse= { 0.50754, 0.50754, 0.50754 }, specular= { 0.508273, 0.508273, 0.508273 }, shininess=0.4 },
	black_plastic  = { ambient= { 0, 0, 0 }, diffuse= { 0.01, 0.01, 0.01 }, specular= { 0.5, 0.5, 0.5 }, shininess=0.25 },
	cyan_plastic   = { ambient= { 0, 0.1, 0.06 }, diffuse= { 0, 0.50980392, 0.50980392 }, specular= { 0.50196078, 0.50196078, 0.50196078 }, shininess=0.25 },
	green_plastic  = { ambient= { 0, 0, 0 }, diffuse= { 0.1, 0.35, 0.1 }, specular= { 0.45, 0.55, 0.45 }, shininess=0.25 },
	red_plastic    = { ambient= { 0, 0, 0 }, diffuse= { 0.5, 0, 0 }, specular= { 0.7, 0.6, 0.6 }, shininess=0.25 },
	white_plastic  = { ambient= { 0, 0, 0 }, diffuse= { 0.55, 0.55, 0.55 }, specular= { 0.7, 0.7, 0.7 }, shininess=0.25 },
	yellow_plastic = { ambient= { 0, 0, 0 }, diffuse= { 0.5, 0.5, 0 }, specular= { 0.6, 0.6, 0.5 }, shininess=0.25 },
	black_rubber   = { ambient= { 0.02, 0.02, 0.02 }, diffuse= { 0.01, 0.01, 0.01 }, specular= { 0.4, 0.4, 0.4 }, shininess=0.078125 },
	cyan_rubber    = { ambient= { 0, 0.05, 0.05 }, diffuse= { 0.4, 0.5, 0.5 }, specular= { 0.04, 0.7, 0.7 }, shininess=0.078125 },
	green_rubber   = { ambient= { 0, 0.05, 0 }, diffuse= { 0.4, 0.5, 0.4 }, specular= { 0.04, 0.7, 0.04 }, shininess=0.078125 },
	red_rubber     = { ambient= { 0.05, 0, 0 }, diffuse= { 0.5, 0.4, 0.4 }, specular= { 0.7, 0.04, 0.04 }, shininess=0.078125 },
	white_rubber   = { ambient= { 0.05, 0.05, 0.05 }, diffuse= { 0.5, 0.5, 0.5 }, specular= { 0.7, 0.7, 0.7 }, shininess=0.078125 },
	yellow_rubber  = { ambient= { 0.05, 0.05, 0 }, diffuse= { 0.5, 0.5, 0.4 }, specular= { 0.7, 0.7, 0.04 }, shininess=0.078125 },
};

materials.bone = { ambient = { 0, 0, 0 }, diffuse = { 1, 1, 0.8 }, specular = { 0, 0, 0 }, shininess = 1 };

materials.primary = {
	red     = primarygenerator(1, 0, 0),
	green   = primarygenerator(0, 1, 0),
	blue    = primarygenerator(0, 0, 1),
	yellow  = primarygenerator(1, 1, 0),
	magenta = primarygenerator(1, 0, 1),
	cyan    = primarygenerator(0, 1, 1),
	
	white   = primarygenerator(1, 1, 1),
	black   = primarygenerator(0, 0, 0),
};
